package me.send.produce.client.controller;

import java.util.Map;

import me.send.business.base.ErrorEntity;
import me.send.business.service.pojo.Commaddress;
import me.send.business.service.service.CommaddressService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value="commaddress",method=RequestMethod.POST)
public class CommaddressController {

	@Autowired
	private CommaddressService commaddressService;
	
	@RequestMapping("save")
	@ResponseBody
	public ErrorEntity save(String devicenumber,Commaddress commaddress){
		return commaddressService.save(devicenumber, commaddress);
	}
	
	@RequestMapping("delete/id")
	@ResponseBody
	public ErrorEntity delete_id(String devicenumber,int addressid){
		return commaddressService.delete_id(devicenumber, addressid);
	}
	
	@RequestMapping("update/id")
	@ResponseBody
	public ErrorEntity update_id(String devicenumber,Commaddress commaddress){
		return commaddressService.update_id(devicenumber, commaddress);
	}
	
	@RequestMapping("list/userid")
	@ResponseBody
	public Map<String, Object> list_userid(String devicenumber,int userid){
		return commaddressService.list_userid(devicenumber, userid);
	}
	
}
